package com.frame.app.backstage.sys.controller;


import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.frame.app.core.rms.model.SystemMenu;
import com.frame.app.core.rms.service.SystemMenuService;


/**
 * 后台框架
 * @author Administrator
 *
 */
@Controller
public class SysController {
	
	
	@RequestMapping("/index")
	public String index(HttpServletRequest request, HttpServletResponse response,ModelMap model) throws Exception {
		//查询系统菜单
		SystemMenu systemMenu = new SystemMenu();
		systemMenu.setPid(0);
		List<SystemMenu> systemMenuList = systemMenu.find();
		model.addAttribute("systemMenuList", systemMenuList);
		//request.setAttribute("model", "测试成功");
		return "backstage/sys/index_new";
	}
	
	@RequestMapping("/leftMenu")
	public String leftMenu(HttpServletRequest request, HttpServletResponse response,ModelMap model) throws Exception {
		//查询系统菜单
		SystemMenu systemMenu = new SystemMenu();
		systemMenu.setPid(0);
		List<SystemMenu> systemMenuList = systemMenu.find();
		model.addAttribute("systemMenuList", systemMenuList);
		//request.setAttribute("model", "测试成功");
		return "backstage/sys/index_sidebar";
	}
	
	@RequestMapping("/login")
	public String login(HttpServletRequest request, HttpServletResponse response,ModelMap model) throws Exception {
		return "backstage/sys/login";
	}
}
